package com.zjw.video.custom.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zjw.video.common.entity.req.TagVideoListReqVO;
import com.zjw.video.common.entity.resp.BaseResp;
import com.zjw.video.common.entity.resp.VideoRespVO;
import com.zjw.video.custom.service.VideoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "视频controller")
@RestController
public class VideoController {

    @Resource
    private VideoService videoService;

    @Operation(summary = "顶部轮播位视频")
    @PostMapping("/topList")
    public BaseResp<List<VideoRespVO>> videoTopList() {
        return videoService.videoTopList();
    }

    @Operation(summary = "视频列表")
    @PostMapping("/tagVideoList")
    public BaseResp<Page<VideoRespVO>> tagVideoList(@RequestBody TagVideoListReqVO tagVideoListReqVO) {
        return BaseResp.success(videoService.tagVideoList(tagVideoListReqVO));
    }

    @Operation(summary = "视频详情")
    @GetMapping("/videoDetail")
    public BaseResp<VideoRespVO> videoDetail(@RequestParam("id") Long id) {
        return BaseResp.success(videoService.videoDetail(id));
    }
}
